package cn.cmeizu.spring6.iocxml.ditest;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author cmeizu
 * @date 2023/2/8 23:58
 */
public class TestEmp {
  public static void main(String[] args) {
    ApplicationContext context = new ClassPathXmlApplicationContext("bean-ditest.xml");
    Emp emp = context.getBean("emp", Emp.class);
    emp.work();

    Emp emp2 = context.getBean("emp2", Emp.class);
    emp2.work();

    Emp emp3 = context.getBean("emp3", Emp.class);
    emp3.work();

    ApplicationContext context2 = new ClassPathXmlApplicationContext("bean-diarray.xml");
    Emp emp1 = context2.getBean("emp", Emp.class);
    emp1.work();
  }
}
